package com.chinasofti.manager.domain;

import java.util.Scanner;

public class TestDemo07 {

    public static void main(String[] args) {
        Demo07 d = new Demo07();
        int conut=1;
        int i=2;
        while (true){
            System.out.println("请输入账号");
            Scanner in = new Scanner(System.in);
            String name = in.next();
            System.out.println("请输入密码");
            String password = in.next();
            if(name.equals(d.name)&&password.equals(password)){
                System.out.println("登录成功");
                break ;
            }else {
                System.out.print("登录失败您还有"+i--+"次机会");
                if (conut==3){
                    System.out.println("本日登录已达上限，请您明天再次尝试登录");
                    break ;
                }
            }
            conut++;
        }
    }
}
